//
//  MTAddPostViewController.m
//  MotorTravel
//
//  Created by zk on 16/9/23.
//  Copyright © 2016年 zk. All rights reserved.
//

#import "MTAddPostViewController.h"
#import "MTAddPostTableViewCell.h"

@interface MTAddPostViewController ()
<
UITableViewDelegate,
UITableViewDataSource
>
@property (weak, nonatomic) IBOutlet UITableView *tableview;
@property (nonatomic, strong) NSMutableArray *PostArray;

@end

@implementation MTAddPostViewController

#pragma mark - life cycle
- (void)viewDidLoad {
    [super viewDidLoad];
    [self loadBaseUI];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)loadBaseUI {
    self.tableview.delegate = self;
    self.tableview.dataSource = self;
    self.tableview.tableFooterView = [UIView new];
}

#pragma mark - tableview datasource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.PostArray.count;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MTAddPostTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MTAddPostTableViewCell"];
    return cell;
}

#pragma mark - Setter & Getter

- (NSMutableArray *)PostArray {
    if (!_PostArray) {
        _PostArray = [[NSMutableArray alloc] init];
    }
    return _PostArray;
}

@end
